import {Storage} from "../../bcat/storage/storage"

interface SettingPageData{
  version:string
}

interface SettingPageMethods{
  showPrivacy():void;
  fingerprint():void;
  showAboutus():void;
  setLanguage():void;
  clearingStorage(): void;
}



Page<SettingPageData,SettingPageMethods>({
  data: {
    version:'v0.0.1'
  },
  onLoad() {
  },

  showAboutus():void{
    my.navigateTo({
      url:'/pages/setting/aboutus/aboutus'
    });
  },
  onReady() {
    // 页面加载完成
  },
  onShow() {
    //
  },
  fingerprint(){
    my.navigateTo({
      url:'/pages/setting/fingerprint/fingerprint'
    });
  },
  setLanguage(){
    my.navigateTo({
      url:'/pages/setting/language/language'
    });
  },
  showPrivacy() {
    my.navigateTo({
      url:'/pages/setting/privacy/privacy'
    });
  },
  clearingStorage() {
    Storage.default().clear();
    //TODO:
    //delete totp 
    //delete the KEY_OF_TERM
    my.showToast({ content: '清理缓存成功'});
  }
});
